﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Migrations;
using Flixr.Data.Model;

namespace Flixr.Data
{
    public static class Seeder
    {
        public static void Seed(FlixrDbContext db)
        {
            db.Movies.AddOrUpdate(
                m => new { m.MovieId, m.Title, m.Rating, m.Description },
                new Movie() { MovieId = 1, Title = "Where the Red Fern Grows", Rating = "X", Description = "Super sad movie about super sad stuff" },
                new Movie() { MovieId = 2, Title = "Old Yeller", Rating = "R", Description = "Another super sad movie about super sad stuff" },
                new Movie() { MovieId = 3, Title = "Land Before Time", Rating = "G", Description = "Dinosaurs do stuff" },
                new Movie() { MovieId = 4, Title = "Interstellar", Rating = "PG-13", Description = "Fly around space and dodge black holes" },
                new Movie() { MovieId = 5, Title = "Pocahontas", Rating = "X", Description = "John Smith spreads his English seed" },
                new Movie() { MovieId = 6, Title = "Top Gun", Rating = "PG-13", Description = "Tom Cruise has semi-man-sex while playing volleyball" },
                new Movie() { MovieId = 7, Title = "Fast and the Furious: Tokyo Drift", Rating = "PG-13", Description = "Asians racing like asians" },
                new Movie() { MovieId = 8, Title = "Fast and Furioius 6", Rating = "R", Description = "Car porn" }
                );

            db.Actors.AddOrUpdate(
                a => new { a.ActorId, a.Name, a.Awards, a.MovieId},
                new Actor() { ActorId = 1, Name = "Wilson Rawls", Awards = 2, MovieId = 1},
                new Actor() { ActorId = 2, Name = "Fess Parker", Awards = 1, MovieId = 2 },
                new Actor() { ActorId = 3, Name = "Gabriel Damon", Awards = 4, MovieId = 3},
                new Actor() { ActorId = 4, Name = "Matthew McConaughey", Awards = 122, MovieId = 4},
                new Actor() { ActorId = 5, Name = "Mel Gibson", Awards = 1, MovieId = 5},
                new Actor() { ActorId = 6, Name = "Tom Cruise", Awards = 99999, MovieId = 6},
                new Actor() { ActorId = 7, Name = "Val Kilmer", Awards = 99999, MovieId = 6 },
                new Actor() { ActorId = 8, Name = "Lucas Black", Awards = 5, MovieId = 7},
                new Actor() { ActorId = 9, Name = "Dwayne 'The Rock' Johnson", Awards = 100000, MovieId = 8}
                );
        }
    }
}
